package com.lly.bigdata.bgayx.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.lly.bigdata.bgayx.entity.SysUser;
import com.lly.bigdata.bgayx.vo.Result;
import com.lly.bigdata.bgayx.vo.SearchModel;
import com.lly.bigdata.bgayx.vo.SysUserVo;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.Set;

/**
 * <p>
 * 系统用户 服务类
 * </p>
 *
 * @author lly
 * @since 2020-10-21
 */
public interface ISysUserService extends IService<SysUser> {

    /**
     * 查询用户角色 用角色代码作为唯一标识
     *
     * @param username
     * @return
     */
    Set<String> getUserRolesSet(String username);

    Result queryPage(SearchModel searchModel);

    /**
     * 用户名获取用户数据
     *
     * @param username
     * @return
     */
    SysUser getUserByName(String username);

    Result selectByUserid(String userid);

    @Transactional(readOnly = false)
    Result addUserRole(SysUserVo user, long loginUserId);

    /**
     * @param username
     * @return
     */
    Boolean ckUserName(String username);

    /**
     * 修改用户
     *
     * @return
     */
    Result updateUser(SysUserVo vo, Long userid);

    /**
     * 修改用户角色
     *
     * @param user
     * @return
     */
    Result updateUserRole(SysUserVo user, Long loginUser);

    /**
     * 删除用户 删除权限
     *
     * @param userid
     */
    void delUser(Long userid);

    void updateUserProfile(Long userid, String ip, Date date);
}
